package cn.ilovese.collect.po.device;

import cn.ilovese.collect.vo.Device.DeviceRequirementVO;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@NoArgsConstructor
public class DeviceRequirement {
    private Integer id;

    private String osList;

    private Integer minRam;

    private Integer maxRam;

    private String processorArchitectureList;

    private Integer taskId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOsList() {
        return osList;
    }

    public void setOsList(String oslist) {
        this.osList = oslist == null ? null : oslist.trim();
    }

    public Integer getMinRam() {
        return minRam;
    }

    public void setMinRam(Integer minRam) {
        this.minRam = minRam;
    }

    public Integer getMaxRam() {
        return maxRam;
    }

    public void setMaxRam(Integer maxRam) {
        this.maxRam = maxRam;
    }

    public String getProcessorArchitectureList() {
        return processorArchitectureList;
    }

    public void setProcessorArchitectureList(String processorArchitectureList) {
        this.processorArchitectureList = processorArchitectureList == null ? null : processorArchitectureList.trim();
    }

    public Integer getTaskId() {
        return taskId;
    }

    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }

    public DeviceRequirement(@NonNull DeviceRequirementVO deviceRequirement){
        this.id=deviceRequirement.getId();
        this.maxRam=deviceRequirement.getMaxRam();
        this.minRam=deviceRequirement.getMinRam();
        String resOsList="";
        for(String temp:deviceRequirement.getOsList()){
            resOsList=resOsList+temp+",";
        }
        this.osList=resOsList;
        this.taskId=deviceRequirement.getTaskId();
        String resProcessorArchitecture="";
        for(String temp:deviceRequirement.getProcessorArchitectureList()){
            resProcessorArchitecture=resProcessorArchitecture+temp+",";
        }
        this.processorArchitectureList=resProcessorArchitecture;
    }
}